package com.yidu.BusinessData.service.impl;

import com.yidu.BusinessData.entity.AssetValuationData;
import com.yidu.BusinessData.entity.assetValuation;
import com.yidu.BusinessData.mapper.assetValuationMapper;
import com.yidu.BusinessData.service.assetValuationService;
import com.yidu.BusinessManagement.entity.DealData;
import com.yidu.InventoryManagement.entity.SecurityAccrualStock;
import com.yidu.InventoryManagement.entity.CashAccrualStock;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author z
 * @version 1.0
 * @date 2022/12/12
 */
@Service
public class assetValuationServiceImpl implements assetValuationService  {
    //调用资产估值Dao类
    @Resource
    assetValuationMapper assetValuationMapper;
    //调用证券应收应付库存service类
    @Resource
    com.yidu.InventoryManagement.service.securityAccrualStockService securityAccrualStockService;
    //调用现金应收应付库存service类
    com.yidu.InventoryManagement.service.cashAccrualStockService cashAccrualStockService;

    /**
     * 查询
     * @param
     * @return
     */
    public Map selectAssetValuation(String assetDate,String assetValuationId) {

        Map layUiMap=new HashMap();

        Map map=new HashMap();

        //插入估值类型和估值状态
        AssetValuationData assetValuation = new AssetValuationData("asse1",1,"1");
        AssetValuationData assetValuation1 = new AssetValuationData("asse2",2,"1");
        List<AssetValuationData> assetValuationList = new ArrayList();
        assetValuationList.add(assetValuation);
        assetValuationList.add(assetValuation1);
     //layui渲染的格式 将数据转化为layui可接受的格式
        layUiMap.put("msg","");
        layUiMap.put("code",0);
        layUiMap.put("data", assetValuationList);
        layUiMap.put("count",2);

        return layUiMap;
    }
    //查询业务日期
    public List<assetValuation> select(String assetDate) {
        Map map=new HashMap();
        map.put("assetDate",assetDate);
        return assetValuationMapper.selectAssetValuations(map);
    }
    //删除证券应收应付库存
    public int deleteSecuritiesInventoryInfos(SecurityAccrualStock securityAccrualStock) {
        return assetValuationMapper.deleteSecuritiesInventoryInfos(securityAccrualStock);
    }
    /***
     * 删除证券应收应付库存 先删后增
     *
     */
    public int deleteSecuritiesInventoryInfoTwo(SecurityAccrualStock securityAccrualStock) {
        return assetValuationMapper.deleteSecuritiesInventoryInfoTwo(securityAccrualStock);
    }

    public List<assetValuation> selectTest(Map map){
        return assetValuationMapper.selectAssetValuations(null);

    }

   //查交易数据的开始时间
    public List<DealData> selectAssetValuationss(String dealTime) {
        return assetValuationMapper.selectAssetValuationss(dealTime);
    }



    public HashMap selectTaTransaction(String assetDate, String assetValuationId) {
        return null;
    }
//删除现金应收应付库存
    public int deleteCashAccrualStock(CashAccrualStock cashAccrualStock) {
        return 0;
    }


//查交易数据开始时间
    @Override
    public double selectMoneyByDate(String dealTime) {
        return assetValuationMapper.selectMoneyByDate(dealTime);
    }


}
